/*
 * Created on Feb 17, 2004
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package ModuleBuilder.model;

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;

import ModuleBuilder.model.ImageCacheDelegate;

/**
 * @author Milton  Soong
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
public class ImageElement implements Serializable {
	
	/**
	 * 
	 */

	// the following two elements might be the same for smaller images
	transient ImageIcon smallIcon;
	ImageIcon fullImageIcon;
	
	public ImageElement( ImageIcon sIn, ImageIcon lIn ) {
		smallIcon = sIn;
		fullImageIcon = lIn;
	}
	
	/**
	 * @return
	 */
	public ImageIcon getFullImageIcon() {
		return fullImageIcon;
	}

	/**
	 * @return
	 */
	public ImageIcon getSmallIcon() {
		return smallIcon;
	}

	/**
	 * @param icon
	 */
	public void setFullImageIcon(ImageIcon icon) {
		fullImageIcon = icon;
	}

	/**
	 * @param icon
	 */
	public void setSmallIcon(ImageIcon icon) {
		smallIcon = icon;
	}
	
	public void makeSmallIconFromLarge() {
		if ( fullImageIcon != null ) {
			smallIcon = ImageCacheDelegate.makeSmallIconFromLarge(fullImageIcon);
		}
	}

	/**
	 * 
	 */
	public ImageElement() {
		super();
		// TODO Auto-generated constructor stub
	}

}
